package com.itheima.chapter10.print;

import java.io.*;

public class PrintDemo1 {
    public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException {
        PrintStream ps = System.out;
        ps.println("你好");
        System.out.println("大家好");
        System.err.println("控制台打印红色");
        ps.close();
        PrintStream ps2 =new PrintStream("b.txt","utf-8");
        ps2.println(98);
        ps2.println(99);
        ps2.println(100);
        ps.close();
        PrintStream ps1 =new PrintStream(new FileOutputStream("b.txt",true));
        ps1.println("打印流追加");
    }
}
